package com.wuxiaofan.coupon.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaofan.coupon.entity.SmsMemberPrice;
import com.wuxiaofan.coupon.entity.custom.SmsMemberPriceCustom;
import com.wuxiaofan.coupon.mapper.SmsMemberPriceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wuxiaofan.coupon.client.Idgenerator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;

@Service
public class SmsMemberPriceService {
    @Autowired
    private SmsMemberPriceMapper smsMemberPriceMapper;
    @Resource
    private Idgenerator idgenerator;
    public SmsMemberPrice findById(String id){
        return smsMemberPriceMapper.selectById(id);
    }

    public SmsMemberPriceCustom findCountByMap(Map paraMap){
        return smsMemberPriceMapper.findCountByMap(paraMap);
    }

    public SmsMemberPriceCustom findGroupByMap(Map paraMap){
        return smsMemberPriceMapper.findGroupByMap(paraMap);
    }

    public List<SmsMemberPriceCustom> findByMap(Map paraMap){
        return smsMemberPriceMapper.findByMap(paraMap);
    }

    public Page<SmsMemberPriceCustom> findByMap(Map paraMap, Page page){
        return page.setRecords(smsMemberPriceMapper.findByMap(paraMap,page));
    }


    public void updateMapById(Map paraMap){
        smsMemberPriceMapper.updateMapById(paraMap);
    }
    public void delById(String id){
        smsMemberPriceMapper.deleteById(id);
    }

    public SmsMemberPrice save(SmsMemberPrice smsMemberPrice){
        smsMemberPrice.setId(idgenerator.getId());
        smsMemberPriceMapper.insert(smsMemberPrice);
        return smsMemberPrice;
    }

}
